package com.becca.cake.model.coupon;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.becca.cake.core.exception.ServiceException;

/**
 * 优惠券销售管理Model
 * @copyright  尊星(上海)信息科技有限公司
 * @author B019
 * @date 2016年8月30日 上午09:36:26
 */
public class CouponSaleSlipModel implements Serializable {

    /**
     * 
     */
    private static final long  serialVersionUID         = 1L;

    /**优惠券类型(0:B2B199）*/
    public static final Byte   COUPON_TYPE_ONE          = 0;
    /**优惠券类型(1:B2B219）*/
    public static final Byte   COUPON_TYPE_TWO          = 1;

    /**销售表状态(0:未删除）*/
    public static final Byte   COUPON_SALE_ISNOT_DELETE = 0;
    /**销售表状态(1:未删除）*/
    public static final Byte   COUPON_SALE_IS_DELETE    = 1;

    /**销售编号不能为空*/
    public static final String COUPON_SALE_ID_NULL      = "销售表编号不能为空";
    /**优惠券类型不能为空*/
    public static final String COUPON_TYPE_NULL         = "优惠券类型不能为空";
    /**优惠券市场价不能为空*/
    public static final String COUPON_MARKET_PRICE_NULL = "优惠券市场价不能为空";
    /**优惠券销售数不能为空*/
    public static final String COUPON_NUMBER_NULL       = "优惠券销售数不能为空";
    /**实际收入不能为空*/
    public static final String SALES_AMOUNT_NULL        = "实际收入不能为空";
    /**该销售表已存在*/
    public static final String COUPONSALE_IS_EXIST      = "该销售表已存在";
    /**该销售表已被删除*/
    public static final String COUPONSALE_IS_NOT_EXIST  = "该销售表已被删除";

    private Integer            id;
    /**优惠券类型(0:B2B199 1:B2B219）*/
    private Byte               couponType;
    /**优惠券市场价*/
    private Double             couponMarketPrice;
    /**优惠券销售数*/
    private Integer            couponNumber;
    /**实际收入*/
    private Double             salesAmount;
    /**是否删除(0:不删除  1:删除)*/
    private Byte               isDelete;

    private String             remark;
    /**创建时间*/
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date               createdDate;
    /**创建人*/
    private String             createdName;

    /**
     * 校验销售表ID是否为空
     * @param couponSaleId
     */
    public static void validCouponSaleIdNull(Integer couponSaleId) {
        if (couponSaleId == null) {
            throw new ServiceException(CouponSaleSlipModel.COUPON_SALE_ID_NULL);
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Byte getCouponType() {
        return couponType;
    }

    public void setCouponType(Byte couponType) {
        this.couponType = couponType;
    }

    public Double getCouponMarketPrice() {
        return couponMarketPrice;
    }

    public void setCouponMarketPrice(Double couponMarketPrice) {
        this.couponMarketPrice = couponMarketPrice;
    }

    public Integer getCouponNumber() {
        return couponNumber;
    }

    public void setCouponNumber(Integer couponNumber) {
        this.couponNumber = couponNumber;
    }

    public Double getSalesAmount() {
        return salesAmount;
    }

    public void setSalesAmount(Double salesAmount) {
        this.salesAmount = salesAmount;
    }

    public Byte getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Byte isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getCreatedName() {
        return createdName;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "CouponSaleSlipModel [id=" + id + ", couponType=" + couponType
               + ", couponMarketPrice=" + couponMarketPrice + ", couponNumber=" + couponNumber
               + ", salesAmount=" + salesAmount + ", isDelete=" + isDelete + ", createdDate="
               + createdDate + ", createdName=" + createdName + "]";
    }

}
